package com.zero.repository;

import com.zero.entity.QCourse;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 课程Repository
 *
 * @author Null
 * @date 2019-10-24
 */

@Service
public class CourseRepositoryImpl implements CourseRepositoryService {
QCourse qCourse=QCourse.course;
    @Autowired
    private JPAQueryFactory queryFactory;

    @Override
    @Transactional
    public Object update() {
        queryFactory.update(qCourse).set(qCourse.name,"eee").where(qCourse.lecturerId.eq(1L)).execute();
        return null;
    }
}
